<ng-container [formGroup]="form">
  <ix-fieldset [title]="'Authentication' | translate">
    <ix-input
      formControlName="user"
      [label]="'User Name' | translate"
      [required]="true"
      [tooltip]="helptext.openstackSwift.user.tooltip | translate"
    ></ix-input>

    <ix-input
      formControlName="key"
      type="password"
      [label]="'API Key or Password' | translate"
      [required]="true"
      [tooltip]="helptext.openstackSwift.key.tooltip | translate"
    ></ix-input>

    <ix-input
      formControlName="auth"
      [label]="'Authentication URL' | translate"
      [required]="true"
      [tooltip]="helptext.openstackSwift.auth.tooltip | translate"
    ></ix-input>

    <ix-select
      formControlName="auth_version"
      [label]="'AuthVersion' | translate"
      [required]="true"
      [options]="authVersions$"
      [tooltip]="helptext.openstackSwift.authVersion.tooltip | translate"
    ></ix-select>
  </ix-fieldset>

  <ix-fieldset [title]="'Advanced Options' | translate">
    @if (isVersion3) {
      <ix-input
        formControlName="user_id"
        [label]="'User ID' | translate"
        [tooltip]="helptext.openstackSwift.userId.tooltip | translate"
      ></ix-input>
      <ix-input
        formControlName="domain"
        [label]="'User Domain' | translate"
        [tooltip]="helptext.openstackSwift.domain.tooltip | translate"
      ></ix-input>
    }
    <ix-input
      formControlName="tenant"
      [label]="'Tenant Name' | translate"
      [tooltip]="helptext.openstackSwift.tenant.tooltip | translate"
    ></ix-input>

    <ix-input
      formControlName="tenant_id"
      [label]="'Tenant ID' | translate"
      [tooltip]="helptext.openstackSwift.tenantId.tooltip | translate"
    ></ix-input>

    @if (isVersion3) {
      <ix-input
        formControlName="tenant_domain"
        [label]="'Tenant Domain' | translate"
        [tooltip]="helptext.openstackSwift.tenantDomain.tooltip | translate"
      ></ix-input>
    }

    <ix-input
      formControlName="auth_token"
      type="password"
      [label]="'Auth Token' | translate"
      [tooltip]="helptext.openstackSwift.authToken.tooltip | translate"
    ></ix-input>

    <ix-input
      formControlName="region"
      [label]="'Region Name' | translate"
      [tooltip]="helptext.openstackSwift.region.tooltip | translate"
    ></ix-input>

    <ix-input
      formControlName="storage_url"
      [label]="'Storage URL' | translate"
      [tooltip]="helptext.openstackSwift.storageUrl.tooltip | translate"
    ></ix-input>

    <ix-select
      formControlName="endpoint_type"
      [label]="'Endpoint Type' | translate"
      [options]="endpointTypes$"
      [required]="true"
      [tooltip]="helptext.openstackSwift.endpointType.tooltip | translate"
    ></ix-select>
  </ix-fieldset>
</ng-container>
